package edu.hunau.cxb18.class06.test;

import edu.hunau.cxb18.spring.aop.service.OrderService;
import edu.hunau.cxb18.spring.aop.service.UserService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * @author hb
 * @create 2020-03-16 10:46
 */
@RunWith(SpringJUnit4ClassRunner.class)   //spring对于junit4的支持
@ContextConfiguration(locations = {"classpath:class06/spring-11-config-aop.xml"})  //读取配置文件

public class AOPConfigTest02 {

    @Autowired
    private UserService userBiz;
    @Autowired
    private OrderService orderBiz;


    @Test
    public void test(){
        System.out.println(userBiz.getClass());
        userBiz.regist("haoren","lucy");
        userBiz.login("haoren","250");
        userBiz.deleteUserById(1001);

        System.out.println("\n\n");

        orderBiz.addOrder();
        orderBiz.deleteOrderById("102123112");
    }
}
